//
//  GrabOrderMainCell.m
//  LogisticsSupplier
//
//  Created by 吕晶 on 2021/3/15.
//  Copyright © 2021 吕晶. All rights reserved.
//

#import "GrabOrderMainCell.h"

@interface GrabOrderMainCell ()

@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UIView *timeLimitView;
@property (nonatomic, strong) UILabel *timeLimitTitleLab;
@property (nonatomic, strong) UILabel *timeLimitLab;

@property (nonatomic, strong) UIView *addressBGView;
@property (nonatomic, strong) UIImageView *tiImgView;
@property (nonatomic, strong) UILabel *tiAddressLab;
@property (nonatomic, strong) UIImageView *songImgView;
@property (nonatomic, strong) UILabel *songAddressLab;
@property (nonatomic, strong) UILabel *linkLine;
@property (nonatomic, strong) UILabel *marginLine1;

@property (nonatomic, strong) UILabel *carTitleLab;
@property (nonatomic, strong) UILabel *carLab;
@property (nonatomic, strong) UILabel *goodTypeTitleLab;
@property (nonatomic, strong) UILabel *goodTypeLab;
@property (nonatomic, strong) UILabel *jnumTitleLab;
@property (nonatomic, strong) UILabel *jnumLab;
@property (nonatomic, strong) UILabel *countTitleLab;
@property (nonatomic, strong) UILabel *countLab;
@property (nonatomic, strong) UILabel *weightTitleLab;
@property (nonatomic, strong) UILabel *weightLab;
@property (nonatomic, strong) UILabel *volumeTitleLab;
@property (nonatomic, strong) UILabel *volumeLab;

@property (nonatomic, strong) UILabel *taskTitleLab;
@property (nonatomic, strong) UIScrollView *scrollView;

@property (nonatomic, strong) UIButton *grabBtn;

@property (nonatomic, strong) UILabel *price1TitleLab;
@property (nonatomic, strong) UILabel *price1Lab;
@property (nonatomic, strong) UILabel *price1UnitLab;

@end

@implementation GrabOrderMainCell

+ (instancetype)GrabOrderMainCellWithTableView:(UITableView *)tableView {
    static NSString *cellID = @"GrabOrderMainCell";
    GrabOrderMainCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[GrabOrderMainCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor clearColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.bgView = [UIView new];
        self.bgView.backgroundColor = HexColor(0xffffff);
        self.bgView.layer.masksToBounds = YES;
        self.bgView.layer.cornerRadius = 6;
        [self.contentView addSubview:self.bgView];
        
        self.timeLimitView = [UIView new];
        self.timeLimitView.backgroundColor = HexColorA(0xF35959, 0.1);
        self.timeLimitView.layer.masksToBounds = YES;
        self.timeLimitView.layer.cornerRadius = 2;
        [self.bgView addSubview:self.timeLimitView];
        
        self.timeLimitTitleLab = [UILabel new];
        self.timeLimitTitleLab.textColor = HexColor(0x2B2C44);
        self.timeLimitTitleLab.font = [UIFont systemFontOfSize:12];
        [self.timeLimitView addSubview:self.timeLimitTitleLab];
        
        self.timeLimitLab = [UILabel new];
        self.timeLimitLab.textColor = HexColor(0xF35959);
        self.timeLimitLab.font = BoldFontOfSize(14);
        [self.timeLimitView addSubview:self.timeLimitLab];
        
        self.addressBGView = [UIView new];
        self.addressBGView.backgroundColor = HexColor(0xF7F7FA);
        [self.bgView addSubview:self.addressBGView];
        
        self.tiImgView = [UIImageView new];
        [self.addressBGView addSubview:self.tiImgView];
        
        self.tiAddressLab = [UILabel new];
        self.tiAddressLab.textColor = HexColor(0x2B2C44);
        self.tiAddressLab.font = BoldFontOfSize(14);
        [self.addressBGView addSubview:self.tiAddressLab];
        
        self.songImgView = [UIImageView new];
        [self.addressBGView addSubview:self.songImgView];
        
        self.songAddressLab = [UILabel new];
        self.songAddressLab.textColor = HexColor(0x2B2C44);
        self.songAddressLab.font = BoldFontOfSize(14);
        [self.addressBGView addSubview:self.songAddressLab];
        
        self.linkLine = [UILabel new];
        self.linkLine.backgroundColor = HexColorA(0x3D68EB, 0.1);
        [self.addressBGView addSubview:self.linkLine];
        
        self.marginLine1 = [UILabel new];
        self.marginLine1.backgroundColor = HexColor(0xF2F2F5);
        [self.addressBGView addSubview:self.marginLine1];
        
        self.carTitleLab = [UILabel new];
        self.carTitleLab.textColor = HexColor(0x9C9DB3);
        self.carTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.carTitleLab];
        
        self.carLab = [UILabel new];
        self.carLab.textColor = HexColor(0x2B2C44);
        self.carLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.carLab];
        
        self.goodTypeTitleLab = [UILabel new];
        self.goodTypeTitleLab.textColor = HexColor(0x9C9DB3);
        self.goodTypeTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.goodTypeTitleLab];
        
        self.goodTypeLab = [UILabel new];
        self.goodTypeLab.textColor = HexColor(0x2B2C44);
        self.goodTypeLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.goodTypeLab];
        
        self.jnumTitleLab = [UILabel new];
        self.jnumTitleLab.textColor = HexColor(0x9C9DB3);
        self.jnumTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.jnumTitleLab];
        
        self.jnumLab = [UILabel new];
        self.jnumLab.textColor = HexColor(0x2B2C44);
        self.jnumLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.jnumLab];
        
        self.countTitleLab = [UILabel new];
        self.countTitleLab.textColor = HexColor(0x9C9DB3);
        self.countTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.countTitleLab];
        
        self.countLab = [UILabel new];
        self.countLab.textColor = HexColor(0x2B2C44);
        self.countLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.countLab];
        
        self.weightTitleLab = [UILabel new];
        self.weightTitleLab.textColor = HexColor(0x9C9DB3);
        self.weightTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.weightTitleLab];
        
        self.weightLab = [UILabel new];
        self.weightLab.textColor = HexColor(0x2B2C44);
        self.weightLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.weightLab];
        
        self.volumeTitleLab = [UILabel new];
        self.volumeTitleLab.textColor = HexColor(0x9C9DB3);
        self.volumeTitleLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.volumeTitleLab];
        
        self.volumeLab = [UILabel new];
        self.volumeLab.textColor = HexColor(0x2B2C44);
        self.volumeLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.volumeLab];
        
        self.taskTitleLab = [UILabel new];
        self.taskTitleLab.textColor = HexColor(0x2B2C44);
        self.taskTitleLab.font = BoldFontOfSize(12);
        [self.bgView addSubview:self.taskTitleLab];
        
        self.scrollView = [UIScrollView new];
        self.scrollView.backgroundColor = HexColor(0xffffff);
        self.scrollView.showsHorizontalScrollIndicator = false;
        [self.bgView addSubview:self.scrollView];
        
        self.grabBtn = [UIButton new];
        [self.grabBtn setTitle:@"立即抢单" forState:0];
        [self.grabBtn setTitleColor:HexColor(0xffffff) forState:0];
        self.grabBtn.titleLabel.font = BoldFontOfSize(16);
        self.grabBtn.backgroundColor = Color_ThemeColor;
        self.grabBtn.layer.masksToBounds = YES;
        self.grabBtn.layer.cornerRadius = 19;
        [self.grabBtn addTarget:self action:@selector(grabClick) forControlEvents:UIControlEventTouchUpInside];
        [self.bgView addSubview:self.grabBtn];
        
        self.price1TitleLab = [UILabel new];
        self.price1TitleLab.textColor = HexColor(0x585974);
        self.price1TitleLab.font = BoldFontOfSize(14);
        [self.bgView addSubview:self.price1TitleLab];
        
        self.price1Lab = [UILabel new];
        self.price1Lab.textColor = HexColor(0xF35959);
        self.price1Lab.font = BoldFontOfSize(20);
        [self.bgView addSubview:self.price1Lab];
        
        self.price1UnitLab = [UILabel new];
        self.price1UnitLab.textColor = HexColor(0x9C9DB3);
        self.price1UnitLab.font = [UIFont systemFontOfSize:14];
        [self.bgView addSubview:self.price1UnitLab];
        
    }
    return self;
}

- (void)grabClick {
    if (self.grabBlock) {
        self.grabBlock();
    }
}

-(void)setModel:(GrabOrderMainModel *)model {
    _model = model;
    [self configUI];
}

- (void)configUI {
    self.bgView.nim_left = 15;
    self.bgView.nim_top = 10;
    self.bgView.nim_width = ScreenW - 30;
    
    if (self.model.countdown) {
        self.timeLimitView.frame = CGRectMake(10, 10, self.bgView.nim_width - 20, 33);
        self.timeLimitTitleLab.text = @"抢单剩余时间";
        [self.timeLimitTitleLab sizeToFit];
        self.timeLimitTitleLab.nim_left = self.timeLimitView.nim_width * 0.5 - 15 - self.timeLimitTitleLab.nim_width;
        self.timeLimitTitleLab.nim_centerY = self.timeLimitView.nim_height * 0.5;
        NSInteger days = (int)(self.model.countdown/(3600*24));
        NSInteger hours = (int)((self.model.countdown-days*24*3600)/3600);
        NSInteger minute = (int)(self.model.countdown-days*24*3600-hours*3600)/60;
        NSInteger second = self.model.countdown - days*24*3600 - hours*3600 - minute*60;
        if (days) {
            self.timeLimitLab.text = [NSString stringWithFormat:@"%ld天%02ld:%02ld:%02ld",days,(long)hours,(long)minute,(long)second];
        }else if (hours) {
            self.timeLimitLab.text = [NSString stringWithFormat:@"%02ld:%02ld:%02ld",(long)hours,(long)minute,(long)second];
        }else {
            self.timeLimitLab.text = [NSString stringWithFormat:@"%02ld:%02ld",(long)minute,(long)second];
        }
        [self.timeLimitLab sizeToFit];
        self.timeLimitLab.nim_left = self.timeLimitView.nim_width * 0.5 - 5;
        self.timeLimitLab.nim_centerY = self.timeLimitView.nim_height * 0.5;
    }
    
    self.addressBGView.frame = CGRectMake(10, 53, self.bgView.nim_width - 20, 105);
    
    self.tiImgView.frame = CGRectMake(10, 15, 22, 22);
    self.tiImgView.image = [UIImage imageNamed:@"icon_add_ti"];
    
    self.songImgView.frame = CGRectMake(10, self.tiImgView.nim_bottom + 30, 22, 22);
    self.songImgView.image = [UIImage imageNamed:@"icon_add_song"];
    
    self.tiAddressLab.text = self.model.s_city;
    [self.tiAddressLab sizeToFit];
    self.tiAddressLab.nim_left = self.tiImgView.nim_right + 15;
    self.tiAddressLab.nim_centerY = self.tiImgView.nim_centerY;
    self.tiAddressLab.nim_width = self.bgView.nim_width - 10 - self.tiAddressLab.nim_left;
    
    self.songAddressLab.text = self.model.r_city;
    [self.songAddressLab sizeToFit];
    self.songAddressLab.nim_left = self.songImgView.nim_right + 15;
    self.songAddressLab.nim_centerY = self.songImgView.nim_centerY;
    self.songAddressLab.nim_width = self.bgView.nim_width - 10 - self.songAddressLab.nim_left;
    
    self.linkLine.nim_centerX = self.tiImgView.nim_centerX;
    self.linkLine.nim_top = self.tiImgView.nim_bottom;
    self.linkLine.nim_width = 2;
    self.linkLine.nim_height = 30;
    
    self.marginLine1.nim_left = self.tiAddressLab.nim_left;
    self.marginLine1.nim_centerY = self.addressBGView.nim_height * 0.5;
    self.marginLine1.nim_width = self.addressBGView.nim_width - self.marginLine1.nim_left;
    self.marginLine1.nim_height = 1;
    
    self.carTitleLab.text = @"车辆要求：";
    [self.carTitleLab sizeToFit];
    self.carTitleLab.nim_left = self.addressBGView.nim_left;
    self.carTitleLab.nim_top = self.addressBGView.nim_bottom + 10;
    
    self.carLab.text = self.model.car_require;
    [self.carLab sizeToFit];
    self.carLab.nim_left = self.carTitleLab.nim_right;
    self.carLab.nim_centerY = self.carTitleLab.nim_centerY;
    self.carLab.nim_width = self.bgView.nim_width - 10 - self.carLab.nim_left;
    
    self.goodTypeTitleLab.text = @"类型：";
    [self.goodTypeTitleLab sizeToFit];
    self.goodTypeTitleLab.nim_left = self.addressBGView.nim_left;
    self.goodTypeTitleLab.nim_top = self.carTitleLab.nim_bottom + 5;
    
    self.goodTypeLab.text = self.model.trans_type;
    [self.goodTypeLab sizeToFit];
    self.goodTypeLab.nim_left = self.goodTypeTitleLab.nim_right;
    self.goodTypeLab.nim_centerY = self.goodTypeTitleLab.nim_centerY;
    self.goodTypeLab.nim_width = self.bgView.nim_width - 10 - self.goodTypeLab.nim_left;
    
    self.jnumTitleLab.text = @"件数：";
    [self.jnumTitleLab sizeToFit];
    self.jnumTitleLab.nim_left = self.addressBGView.nim_left;
    self.jnumTitleLab.nim_top = self.goodTypeTitleLab.nim_bottom + 5;
    
    self.jnumLab.text = [NSString stringWithFormat:@"%@件",self.model.pnum];
    [self.jnumLab sizeToFit];
    self.jnumLab.nim_left = self.jnumTitleLab.nim_right;
    self.jnumLab.nim_centerY = self.jnumTitleLab.nim_centerY;
    self.jnumLab.nim_width = self.bgView.nim_width * 0.5 - self.jnumLab.nim_left;
    
    self.countTitleLab.text = @"数量：";
    [self.countTitleLab sizeToFit];
    self.countTitleLab.nim_left = self.bgView.nim_width * 0.5;
    self.countTitleLab.nim_centerY = self.jnumTitleLab.nim_centerY;
    
    self.countLab.text = [NSString stringWithFormat:@"%@",self.model.num];
    [self.countLab sizeToFit];
    self.countLab.nim_left = self.countTitleLab.nim_right;
    self.countLab.nim_centerY = self.countTitleLab.nim_centerY;
    self.countLab.nim_width = self.bgView.nim_width - 10 - self.countLab.nim_left;
    
    self.weightTitleLab.text = @"重量：";
    [self.weightTitleLab sizeToFit];
    self.weightTitleLab.nim_left = self.addressBGView.nim_left;
    self.weightTitleLab.nim_top = self.jnumTitleLab.nim_bottom + 5;
    
    self.weightLab.text = [self.model.weight floatValue] ? [NSString stringWithFormat:@"%@KG",self.model.weight] : @"--KG";
    [self.weightLab sizeToFit];
    self.weightLab.nim_left = self.weightTitleLab.nim_right;
    self.weightLab.nim_centerY = self.weightTitleLab.nim_centerY;
    self.weightLab.nim_width = self.bgView.nim_width * 0.5 - self.weightLab.nim_left;
    
    self.volumeTitleLab.text = @"体积：";
    [self.volumeTitleLab sizeToFit];
    self.volumeTitleLab.nim_left = self.bgView.nim_width * 0.5;
    self.volumeTitleLab.nim_centerY = self.weightTitleLab.nim_centerY;
    
    self.volumeLab.text = [self.model.volume floatValue] ? [NSString stringWithFormat:@"%@m³",self.model.volume] : @"--m³";
    [self.volumeLab sizeToFit];
    self.volumeLab.nim_left = self.volumeTitleLab.nim_right;
    self.volumeLab.nim_centerY = self.volumeTitleLab.nim_centerY;
    self.volumeLab.nim_width = self.bgView.nim_width - 10 - self.volumeLab.nim_left;
    
    self.taskTitleLab.text = [NSString stringWithFormat:@"任务明细(%lu)",(unsigned long)self.model.the_list.count];
    [self.taskTitleLab sizeToFit];
    self.taskTitleLab.nim_left = self.addressBGView.nim_left;
    self.taskTitleLab.nim_top = self.weightTitleLab.nim_bottom + 20;
    
    self.scrollView.frame = CGRectMake(self.taskTitleLab.nim_left, self.taskTitleLab.nim_bottom + 5, self.bgView.nim_width - 2 * self.taskTitleLab.nim_left, 90);
    self.scrollView.contentSize = CGSizeMake((self.bgView.nim_width - 10 - 40) * self.model.the_list.count, self.scrollView.nim_height);
    
    [self.scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
    [self.model.the_list enumerateObjectsUsingBlock:^(GrabOrderTaskModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        GrabOrderTaskView *view = [[GrabOrderTaskView alloc] initWithFrame:CGRectMake((self.bgView.nim_width - 10 - 40) * idx, 0, (self.bgView.nim_width - 10 - 40), self.scrollView.nim_height)];
        view.model = obj;
        [self.scrollView addSubview:view];
    }];
    
    self.grabBtn.frame = CGRectMake(self.bgView.nim_width - 20 - 120, self.scrollView.nim_bottom + 15, 120, 38);
    
    self.price1TitleLab.text = @"价格";
    [self.price1TitleLab sizeToFit];
    self.price1TitleLab.nim_left = self.taskTitleLab.nim_left;
    self.price1TitleLab.nim_centerY = self.grabBtn.nim_centerY;
    
    self.price1Lab.text = self.model.price;
    [self.price1Lab sizeToFit];
    self.price1Lab.nim_left = self.price1TitleLab.nim_right + 10;
    self.price1Lab.nim_centerY = self.price1TitleLab.nim_centerY;
    
    self.price1UnitLab.text = @"元";
    [self.price1UnitLab sizeToFit];
    self.price1UnitLab.nim_left = self.price1Lab.nim_right + 5;
    self.price1UnitLab.nim_centerY = self.price1Lab.nim_centerY;
    
    self.bgView.nim_height = self.grabBtn.nim_bottom + 15;
    
    self.height = self.bgView.nim_bottom;
}

- (void)configWithTime:(long)downtime {
    if (downtime > 0) {
        NSInteger days = (int)(downtime/(3600*24));
        NSInteger hours = (int)((downtime-days*24*3600)/3600);
        NSInteger minute = (int)(downtime-days*24*3600-hours*3600)/60;
        NSInteger second = downtime - days*24*3600 - hours*3600 - minute*60;
        if (days) {
            self.timeLimitLab.text = [NSString stringWithFormat:@"%ld天%02ld:%02ld:%02ld",days,(long)hours,(long)minute,(long)second];
        }else if (hours) {
            self.timeLimitLab.text = [NSString stringWithFormat:@"%02ld:%02ld:%02ld",(long)hours,(long)minute,(long)second];
        }else {
            self.timeLimitLab.text = [NSString stringWithFormat:@"%02ld:%02ld",(long)minute,(long)second];
        }
        [self.timeLimitLab sizeToFit];
        self.timeLimitLab.nim_left = self.timeLimitView.nim_width * 0.5 - 5;
        self.timeLimitLab.nim_centerY = self.timeLimitView.nim_height * 0.5;
    }else {
        self.timeLimitLab.text = @"00:00";
        [self.timeLimitLab sizeToFit];
        self.timeLimitLab.nim_left = self.timeLimitView.nim_width * 0.5 - 5;
        self.timeLimitLab.nim_centerY = self.timeLimitView.nim_height * 0.5;
        if (self.refreshBlock) {
            self.refreshBlock();
        }
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end

@interface GrabOrderTaskView ()

@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UILabel *title1Lab;
@property (nonatomic, strong) UILabel *content1Lab;
@property (nonatomic, strong) UILabel *title2Lab;
@property (nonatomic, strong) UILabel *content2Lab;
@property (nonatomic, strong) UILabel *title3Lab;
@property (nonatomic, strong) UILabel *content3Lab;

@end

@implementation GrabOrderTaskView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = HexColor(0xffffff);
        self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width - 5, frame.size.height)];
        self.bgView.layer.masksToBounds = YES;
        self.bgView.layer.cornerRadius = 2;
        self.bgView.layer.borderWidth = 1;
        self.bgView.layer.borderColor = HexColor(0xF2F2F5).CGColor;
        [self addSubview:self.bgView];
        
        self.title1Lab = [UILabel new];
        self.title1Lab.text = @"提货时间：";
        self.title1Lab.font = [UIFont systemFontOfSize:12];
        self.title1Lab.textColor = HexColor(0x9C9DB3);
        [self.title1Lab sizeToFit];
        self.title1Lab.nim_left = 10;
        self.title1Lab.nim_top = (self.bgView.nim_height - 3 * self.title1Lab.nim_height - 2 * 5) * 0.5;
        [self.bgView addSubview:self.title1Lab];
        
        self.content1Lab = [[UILabel alloc] initWithFrame:CGRectMake(self.title1Lab.nim_right, self.title1Lab.nim_top, self.bgView.nim_width - 10 - self.title1Lab.nim_right, self.title1Lab.nim_height)];
        self.content1Lab.textColor = HexColor(0x2B2C44);
        self.content1Lab.font = [UIFont systemFontOfSize:12];
        [self.bgView addSubview:self.content1Lab];
        
        self.title2Lab = [UILabel new];
        self.title2Lab.text = @"要求到达时间：";
        self.title2Lab.font = [UIFont systemFontOfSize:12];
        self.title2Lab.textColor = HexColor(0x9C9DB3);
        [self.title2Lab sizeToFit];
        self.title2Lab.nim_left = 10;
        self.title2Lab.nim_top = self.title1Lab.nim_bottom + 5;
        [self.bgView addSubview:self.title2Lab];
        
        self.content2Lab = [[UILabel alloc] initWithFrame:CGRectMake(self.title2Lab.nim_right, self.title2Lab.nim_top, self.bgView.nim_width - 10 - self.title2Lab.nim_right, self.title2Lab.nim_height)];
        self.content2Lab.textColor = HexColor(0x2B2C44);
        self.content2Lab.font = [UIFont systemFontOfSize:12];
        [self.bgView addSubview:self.content2Lab];
        
        self.title3Lab = [UILabel new];
        self.title3Lab.text = @"运输注意事项：";
        self.title3Lab.font = [UIFont systemFontOfSize:12];
        self.title3Lab.textColor = HexColor(0x9C9DB3);
        [self.title3Lab sizeToFit];
        self.title3Lab.nim_left = 10;
        self.title3Lab.nim_top = self.title2Lab.nim_bottom + 5;
        [self.bgView addSubview:self.title3Lab];
        
        self.content3Lab = [[UILabel alloc] initWithFrame:CGRectMake(self.title3Lab.nim_right, self.title3Lab.nim_top, self.bgView.nim_width - 10 - self.title3Lab.nim_right, self.title3Lab.nim_height)];
        self.content3Lab.textColor = HexColor(0x2B2C44);
        self.content3Lab.font = [UIFont systemFontOfSize:12];
        [self.bgView addSubview:self.content3Lab];
    }
    return self;
}

-(void)setModel:(GrabOrderTaskModel *)model {
    _model = model;
    self.content1Lab.text = model.start_time;
    self.content2Lab.text = model.arrival_time;
    self.content3Lab.text = model.remarks;
}

@end
